package o;

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Paint.Cap;
import android.graphics.Paint.Join;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.Path.FillType;
import android.graphics.PathMeasure;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.ConstantState;
import android.graphics.drawable.VectorDrawable;
import android.os.Build.VERSION;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Xml;
import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import com.huawei.appgallery.festivalanimation.particle.modifiers.SizeModifier;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class ov extends ou {
    static final Mode ˊ = Mode.SRC_IN;
    private ConstantState ʻ;
    private boolean ʼ;
    private boolean ʽ;
    private ColorFilter ˋ;
    private PorterDuffColorFilter ˏ;
    private final Rect ͺ;
    private j ॱ;
    private final Matrix ॱॱ;
    private final float[] ᐝ;

    static abstract class a {
        private a() {
        }

        public boolean ˏ() {
            return false;
        }

        public boolean ˋ(int[] iArr) {
            return false;
        }
    }

    static abstract class e extends a {
        protected o.fw.d[] ˊॱ = null;
        String ˋॱ;
        int ˏॱ;

        public e() {
            super();
        }

        public e(e eVar) {
            super();
            this.ˋॱ = eVar.ˋॱ;
            this.ˏॱ = eVar.ˏॱ;
            this.ˊॱ = fw.ˊ(eVar.ˊॱ);
        }

        public void ˎ(Path path) {
            path.reset();
            if (this.ˊॱ != null) {
                o.fw.d.ˎ(this.ˊॱ, path);
            }
        }

        public String getPathName() {
            return this.ˋॱ;
        }

        public boolean ˊ() {
            return false;
        }

        public o.fw.d[] getPathData() {
            return this.ˊॱ;
        }

        public void setPathData(o.fw.d[] dVarArr) {
            if (fw.ˋ(this.ˊॱ, dVarArr)) {
                fw.ˏ(this.ˊॱ, dVarArr);
            } else {
                this.ˊॱ = fw.ˊ(dVarArr);
            }
        }
    }

    static class b extends e {
        float ʻ = 1.0f;
        Cap ʼ = Cap.BUTT;
        float ʽ = 0.0f;
        float ˊ = 0.0f;
        float ˋ = 1.0f;
        fr ˎ;
        int ˏ = 0;
        float ͺ = 4.0f;
        fr ॱ;
        Join ॱˊ = Join.MITER;
        float ॱॱ = 1.0f;
        private int[] ॱᐝ;
        float ᐝ = 0.0f;

        public b(b bVar) {
            super(bVar);
            this.ॱᐝ = bVar.ॱᐝ;
            this.ˎ = bVar.ˎ;
            this.ˊ = bVar.ˊ;
            this.ˋ = bVar.ˋ;
            this.ॱ = bVar.ॱ;
            this.ˏ = bVar.ˏ;
            this.ʻ = bVar.ʻ;
            this.ʽ = bVar.ʽ;
            this.ॱॱ = bVar.ॱॱ;
            this.ᐝ = bVar.ᐝ;
            this.ʼ = bVar.ʼ;
            this.ॱˊ = bVar.ॱˊ;
            this.ͺ = bVar.ͺ;
        }

        private Cap ˊ(int i, Cap cap) {
            switch (i) {
                case 0:
                    return Cap.BUTT;
                case 1:
                    return Cap.ROUND;
                case 2:
                    return Cap.SQUARE;
                default:
                    return cap;
            }
        }

        private Join ˋ(int i, Join join) {
            switch (i) {
                case 0:
                    return Join.MITER;
                case 1:
                    return Join.ROUND;
                case 2:
                    return Join.BEVEL;
                default:
                    return join;
            }
        }

        public void ˏ(Resources resources, AttributeSet attributeSet, Theme theme, XmlPullParser xmlPullParser) {
            TypedArray ˎ = fx.ˎ(resources, theme, attributeSet, op.ˏ);
            ˏ(ˎ, xmlPullParser, theme);
            ˎ.recycle();
        }

        private void ˏ(TypedArray typedArray, XmlPullParser xmlPullParser, Theme theme) {
            this.ॱᐝ = null;
            if (fx.ˊ(xmlPullParser, "pathData")) {
                String string = typedArray.getString(0);
                if (string != null) {
                    this.ˋॱ = string;
                }
                string = typedArray.getString(2);
                if (string != null) {
                    this.ˊॱ = fw.ॱ(string);
                }
                this.ॱ = fx.ˏ(typedArray, xmlPullParser, theme, "fillColor", 1, 0);
                this.ʻ = fx.ॱ(typedArray, xmlPullParser, "fillAlpha", 12, this.ʻ);
                this.ʼ = ˊ(fx.ˊ(typedArray, xmlPullParser, "strokeLineCap", 8, -1), this.ʼ);
                this.ॱˊ = ˋ(fx.ˊ(typedArray, xmlPullParser, "strokeLineJoin", 9, -1), this.ॱˊ);
                this.ͺ = fx.ॱ(typedArray, xmlPullParser, "strokeMiterLimit", 10, this.ͺ);
                this.ˎ = fx.ˏ(typedArray, xmlPullParser, theme, "strokeColor", 3, 0);
                this.ˋ = fx.ॱ(typedArray, xmlPullParser, "strokeAlpha", 11, this.ˋ);
                this.ˊ = fx.ॱ(typedArray, xmlPullParser, "strokeWidth", 4, this.ˊ);
                this.ॱॱ = fx.ॱ(typedArray, xmlPullParser, "trimPathEnd", 6, this.ॱॱ);
                this.ᐝ = fx.ॱ(typedArray, xmlPullParser, "trimPathOffset", 7, this.ᐝ);
                this.ʽ = fx.ॱ(typedArray, xmlPullParser, "trimPathStart", 5, this.ʽ);
                this.ˏ = fx.ˊ(typedArray, xmlPullParser, "fillType", 13, this.ˏ);
            }
        }

        public boolean ˏ() {
            return this.ॱ.ˊ() || this.ˎ.ˊ();
        }

        public boolean ˋ(int[] iArr) {
            return this.ॱ.ˎ(iArr) | this.ˎ.ˎ(iArr);
        }

        @ColorInt
        int getStrokeColor() {
            return this.ˎ.ˋ();
        }

        void setStrokeColor(int i) {
            this.ˎ.ˊ(i);
        }

        float getStrokeWidth() {
            return this.ˊ;
        }

        void setStrokeWidth(float f) {
            this.ˊ = f;
        }

        float getStrokeAlpha() {
            return this.ˋ;
        }

        void setStrokeAlpha(float f) {
            this.ˋ = f;
        }

        @ColorInt
        int getFillColor() {
            return this.ॱ.ˋ();
        }

        void setFillColor(int i) {
            this.ॱ.ˊ(i);
        }

        float getFillAlpha() {
            return this.ʻ;
        }

        void setFillAlpha(float f) {
            this.ʻ = f;
        }

        float getTrimPathStart() {
            return this.ʽ;
        }

        void setTrimPathStart(float f) {
            this.ʽ = f;
        }

        float getTrimPathEnd() {
            return this.ॱॱ;
        }

        void setTrimPathEnd(float f) {
            this.ॱॱ = f;
        }

        float getTrimPathOffset() {
            return this.ᐝ;
        }

        void setTrimPathOffset(float f) {
            this.ᐝ = f;
        }
    }

    static class c extends a {
        private float ʻ = 0.0f;
        private float ʼ = 1.0f;
        private float ʽ = 1.0f;
        float ˊ = 0.0f;
        final Matrix ˋ = new Matrix();
        private float ˋॱ = 0.0f;
        final Matrix ˎ = new Matrix();
        int ˏ;
        private int[] ˏॱ;
        private String ͺ = null;
        final ArrayList<a> ॱ = new ArrayList();
        private float ॱॱ = 0.0f;
        private float ᐝ = 0.0f;

        public c(c cVar, ds<String, Object> dsVar) {
            super();
            this.ˊ = cVar.ˊ;
            this.ᐝ = cVar.ᐝ;
            this.ʻ = cVar.ʻ;
            this.ʼ = cVar.ʼ;
            this.ʽ = cVar.ʽ;
            this.ॱॱ = cVar.ॱॱ;
            this.ˋॱ = cVar.ˋॱ;
            this.ˏॱ = cVar.ˏॱ;
            this.ͺ = cVar.ͺ;
            this.ˏ = cVar.ˏ;
            if (this.ͺ != null) {
                dsVar.put(this.ͺ, this);
            }
            this.ˋ.set(cVar.ˋ);
            ArrayList arrayList = cVar.ॱ;
            for (int i = 0; i < arrayList.size(); i++) {
                Object obj = arrayList.get(i);
                if (obj instanceof c) {
                    this.ॱ.add(new c((c) obj, dsVar));
                } else {
                    e bVar;
                    if (obj instanceof b) {
                        bVar = new b((b) obj);
                    } else if (obj instanceof d) {
                        bVar = new d((d) obj);
                    } else {
                        throw new IllegalStateException("Unknown object in the tree!");
                    }
                    this.ॱ.add(bVar);
                    if (bVar.ˋॱ != null) {
                        dsVar.put(bVar.ˋॱ, bVar);
                    }
                }
            }
        }

        public c() {
            super();
        }

        public String getGroupName() {
            return this.ͺ;
        }

        public Matrix getLocalMatrix() {
            return this.ˋ;
        }

        public void ˏ(Resources resources, AttributeSet attributeSet, Theme theme, XmlPullParser xmlPullParser) {
            TypedArray ˎ = fx.ˎ(resources, theme, attributeSet, op.ˊ);
            ˏ(ˎ, xmlPullParser);
            ˎ.recycle();
        }

        private void ˏ(TypedArray typedArray, XmlPullParser xmlPullParser) {
            this.ˏॱ = null;
            this.ˊ = fx.ॱ(typedArray, xmlPullParser, "rotation", 5, this.ˊ);
            this.ᐝ = typedArray.getFloat(1, this.ᐝ);
            this.ʻ = typedArray.getFloat(2, this.ʻ);
            this.ʼ = fx.ॱ(typedArray, xmlPullParser, "scaleX", 3, this.ʼ);
            this.ʽ = fx.ॱ(typedArray, xmlPullParser, "scaleY", 4, this.ʽ);
            this.ॱॱ = fx.ॱ(typedArray, xmlPullParser, "translateX", 6, this.ॱॱ);
            this.ˋॱ = fx.ॱ(typedArray, xmlPullParser, "translateY", 7, this.ˋॱ);
            String string = typedArray.getString(0);
            if (string != null) {
                this.ͺ = string;
            }
            ॱ();
        }

        private void ॱ() {
            this.ˋ.reset();
            this.ˋ.postTranslate(-this.ᐝ, -this.ʻ);
            this.ˋ.postScale(this.ʼ, this.ʽ);
            this.ˋ.postRotate(this.ˊ, 0.0f, 0.0f);
            this.ˋ.postTranslate(this.ॱॱ + this.ᐝ, this.ˋॱ + this.ʻ);
        }

        public float getRotation() {
            return this.ˊ;
        }

        public void setRotation(float f) {
            if (f != this.ˊ) {
                this.ˊ = f;
                ॱ();
            }
        }

        public float getPivotX() {
            return this.ᐝ;
        }

        public void setPivotX(float f) {
            if (f != this.ᐝ) {
                this.ᐝ = f;
                ॱ();
            }
        }

        public float getPivotY() {
            return this.ʻ;
        }

        public void setPivotY(float f) {
            if (f != this.ʻ) {
                this.ʻ = f;
                ॱ();
            }
        }

        public float getScaleX() {
            return this.ʼ;
        }

        public void setScaleX(float f) {
            if (f != this.ʼ) {
                this.ʼ = f;
                ॱ();
            }
        }

        public float getScaleY() {
            return this.ʽ;
        }

        public void setScaleY(float f) {
            if (f != this.ʽ) {
                this.ʽ = f;
                ॱ();
            }
        }

        public float getTranslateX() {
            return this.ॱॱ;
        }

        public void setTranslateX(float f) {
            if (f != this.ॱॱ) {
                this.ॱॱ = f;
                ॱ();
            }
        }

        public float getTranslateY() {
            return this.ˋॱ;
        }

        public void setTranslateY(float f) {
            if (f != this.ˋॱ) {
                this.ˋॱ = f;
                ॱ();
            }
        }

        public boolean ˏ() {
            for (int i = 0; i < this.ॱ.size(); i++) {
                if (((a) this.ॱ.get(i)).ˏ()) {
                    return true;
                }
            }
            return false;
        }

        public boolean ˋ(int[] iArr) {
            boolean z = false;
            for (int i = 0; i < this.ॱ.size(); i++) {
                z |= ((a) this.ॱ.get(i)).ˋ(iArr);
            }
            return z;
        }
    }

    static class d extends e {
        public d(d dVar) {
            super(dVar);
        }

        public void ˋ(Resources resources, AttributeSet attributeSet, Theme theme, XmlPullParser xmlPullParser) {
            if (fx.ˊ(xmlPullParser, "pathData")) {
                TypedArray ˎ = fx.ˎ(resources, theme, attributeSet, op.ˋ);
                ˋ(ˎ);
                ˎ.recycle();
            }
        }

        private void ˋ(TypedArray typedArray) {
            String string = typedArray.getString(0);
            if (string != null) {
                this.ˋॱ = string;
            }
            string = typedArray.getString(1);
            if (string != null) {
                this.ˊॱ = fw.ॱ(string);
            }
        }

        public boolean ˊ() {
            return true;
        }
    }

    @RequiresApi(24)
    static class f extends ConstantState {
        private final ConstantState ˋ;

        public f(ConstantState constantState) {
            this.ˋ = constantState;
        }

        public Drawable newDrawable() {
            Drawable ovVar = new ov();
            ovVar.ˎ = (VectorDrawable) this.ˋ.newDrawable();
            return ovVar;
        }

        public Drawable newDrawable(Resources resources) {
            Drawable ovVar = new ov();
            ovVar.ˎ = (VectorDrawable) this.ˋ.newDrawable(resources);
            return ovVar;
        }

        public Drawable newDrawable(Resources resources, Theme theme) {
            Drawable ovVar = new ov();
            ovVar.ˎ = (VectorDrawable) this.ˋ.newDrawable(resources, theme);
            return ovVar;
        }

        public boolean canApplyTheme() {
            return this.ˋ.canApplyTheme();
        }

        public int getChangingConfigurations() {
            return this.ˋ.getChangingConfigurations();
        }
    }

    static class g {
        private static final Matrix ˋॱ = new Matrix();
        String ʻ;
        private int ʻॱ;
        float ʼ;
        Boolean ʽ;
        float ˊ;
        private final Matrix ˊॱ;
        Paint ˋ;
        final c ˎ;
        Paint ˏ;
        private final Path ˏॱ;
        private final Path ͺ;
        float ॱ;
        final ds<String, Object> ॱˊ;
        private PathMeasure ॱˎ;
        float ॱॱ;
        int ᐝ;

        public g() {
            this.ˊॱ = new Matrix();
            this.ॱ = 0.0f;
            this.ˊ = 0.0f;
            this.ॱॱ = 0.0f;
            this.ʼ = 0.0f;
            this.ᐝ = 255;
            this.ʻ = null;
            this.ʽ = null;
            this.ॱˊ = new ds();
            this.ˎ = new c();
            this.ˏॱ = new Path();
            this.ͺ = new Path();
        }

        public void setRootAlpha(int i) {
            this.ᐝ = i;
        }

        public int getRootAlpha() {
            return this.ᐝ;
        }

        public void setAlpha(float f) {
            setRootAlpha((int) (255.0f * f));
        }

        public float getAlpha() {
            return ((float) getRootAlpha()) / 255.0f;
        }

        public g(g gVar) {
            this.ˊॱ = new Matrix();
            this.ॱ = 0.0f;
            this.ˊ = 0.0f;
            this.ॱॱ = 0.0f;
            this.ʼ = 0.0f;
            this.ᐝ = 255;
            this.ʻ = null;
            this.ʽ = null;
            this.ॱˊ = new ds();
            this.ˎ = new c(gVar.ˎ, this.ॱˊ);
            this.ˏॱ = new Path(gVar.ˏॱ);
            this.ͺ = new Path(gVar.ͺ);
            this.ॱ = gVar.ॱ;
            this.ˊ = gVar.ˊ;
            this.ॱॱ = gVar.ॱॱ;
            this.ʼ = gVar.ʼ;
            this.ʻॱ = gVar.ʻॱ;
            this.ᐝ = gVar.ᐝ;
            this.ʻ = gVar.ʻ;
            if (gVar.ʻ != null) {
                this.ॱˊ.put(gVar.ʻ, this);
            }
            this.ʽ = gVar.ʽ;
        }

        private void ˏ(c cVar, Matrix matrix, Canvas canvas, int i, int i2, ColorFilter colorFilter) {
            cVar.ˎ.set(matrix);
            cVar.ˎ.preConcat(cVar.ˋ);
            canvas.save();
            for (int i3 = 0; i3 < cVar.ॱ.size(); i3++) {
                a aVar = (a) cVar.ॱ.get(i3);
                if (aVar instanceof c) {
                    ˏ((c) aVar, cVar.ˎ, canvas, i, i2, colorFilter);
                } else if (aVar instanceof e) {
                    ˏ(cVar, (e) aVar, canvas, i, i2, colorFilter);
                }
            }
            canvas.restore();
        }

        public void ˏ(Canvas canvas, int i, int i2, ColorFilter colorFilter) {
            ˏ(this.ˎ, ˋॱ, canvas, i, i2, colorFilter);
        }

        private void ˏ(c cVar, e eVar, Canvas canvas, int i, int i2, ColorFilter colorFilter) {
            float f = ((float) i) / this.ॱॱ;
            float f2 = ((float) i2) / this.ʼ;
            float min = Math.min(f, f2);
            Matrix matrix = cVar.ˎ;
            this.ˊॱ.set(matrix);
            this.ˊॱ.postScale(f, f2);
            f2 = ˎ(matrix);
            if (f2 != 0.0f) {
                eVar.ˎ(this.ˏॱ);
                Path path = this.ˏॱ;
                this.ͺ.reset();
                if (eVar.ˊ()) {
                    this.ͺ.addPath(path, this.ˊॱ);
                    canvas.clipPath(this.ͺ);
                    return;
                }
                fr frVar;
                Paint paint;
                Shader ˎ;
                b bVar = (b) eVar;
                if (!(bVar.ʽ == 0.0f && bVar.ॱॱ == 1.0f)) {
                    float f3 = (bVar.ʽ + bVar.ᐝ) % 1.0f;
                    float f4 = (bVar.ॱॱ + bVar.ᐝ) % 1.0f;
                    if (this.ॱˎ == null) {
                        this.ॱˎ = new PathMeasure();
                    }
                    this.ॱˎ.setPath(this.ˏॱ, false);
                    float length = this.ॱˎ.getLength();
                    f3 *= length;
                    f4 *= length;
                    path.reset();
                    if (f3 > f4) {
                        this.ॱˎ.getSegment(f3, length, path, true);
                        this.ॱˎ.getSegment(0.0f, f4, path, true);
                    } else {
                        this.ॱˎ.getSegment(f3, f4, path, true);
                    }
                    path.rLineTo(0.0f, 0.0f);
                }
                this.ͺ.addPath(path, this.ˊॱ);
                if (bVar.ॱ.ॱ()) {
                    frVar = bVar.ॱ;
                    if (this.ˋ == null) {
                        this.ˋ = new Paint(1);
                        this.ˋ.setStyle(Style.FILL);
                    }
                    paint = this.ˋ;
                    if (frVar.ˏ()) {
                        ˎ = frVar.ˎ();
                        ˎ.setLocalMatrix(this.ˊॱ);
                        paint.setShader(ˎ);
                        paint.setAlpha(Math.round(bVar.ʻ * 255.0f));
                    } else {
                        paint.setShader(null);
                        paint.setAlpha(255);
                        paint.setColor(ov.ˋ(frVar.ˋ(), bVar.ʻ));
                    }
                    paint.setColorFilter(colorFilter);
                    this.ͺ.setFillType(bVar.ˏ == 0 ? FillType.WINDING : FillType.EVEN_ODD);
                    canvas.drawPath(this.ͺ, paint);
                }
                if (bVar.ˎ.ॱ()) {
                    frVar = bVar.ˎ;
                    if (this.ˏ == null) {
                        this.ˏ = new Paint(1);
                        this.ˏ.setStyle(Style.STROKE);
                    }
                    paint = this.ˏ;
                    if (bVar.ॱˊ != null) {
                        paint.setStrokeJoin(bVar.ॱˊ);
                    }
                    if (bVar.ʼ != null) {
                        paint.setStrokeCap(bVar.ʼ);
                    }
                    paint.setStrokeMiter(bVar.ͺ);
                    if (frVar.ˏ()) {
                        ˎ = frVar.ˎ();
                        ˎ.setLocalMatrix(this.ˊॱ);
                        paint.setShader(ˎ);
                        paint.setAlpha(Math.round(bVar.ˋ * 255.0f));
                    } else {
                        paint.setShader(null);
                        paint.setAlpha(255);
                        paint.setColor(ov.ˋ(frVar.ˋ(), bVar.ˋ));
                    }
                    paint.setColorFilter(colorFilter);
                    paint.setStrokeWidth((min * f2) * bVar.ˊ);
                    canvas.drawPath(this.ͺ, paint);
                }
            }
        }

        private static float ॱ(float f, float f2, float f3, float f4) {
            return (f * f4) - (f2 * f3);
        }

        private float ˎ(Matrix matrix) {
            float[] fArr = new float[]{0.0f, 1.0f, 1.0f, 0.0f};
            matrix.mapVectors(fArr);
            float hypot = (float) Math.hypot((double) fArr[0], (double) fArr[1]);
            float hypot2 = (float) Math.hypot((double) fArr[2], (double) fArr[3]);
            float ॱ = ॱ(fArr[0], fArr[1], fArr[2], fArr[3]);
            hypot = Math.max(hypot, hypot2);
            if (hypot > 0.0f) {
                return Math.abs(ॱ) / hypot;
            }
            return 0.0f;
        }

        public boolean ˊ() {
            if (this.ʽ == null) {
                this.ʽ = Boolean.valueOf(this.ˎ.ˏ());
            }
            return this.ʽ.booleanValue();
        }

        public boolean ˎ(int[] iArr) {
            return this.ˎ.ˋ(iArr);
        }
    }

    static class j extends ConstantState {
        ColorStateList ʻ;
        Mode ʼ;
        Bitmap ʽ;
        boolean ˊ;
        g ˋ;
        Paint ˋॱ;
        Mode ˎ;
        ColorStateList ˏ;
        boolean ͺ;
        int ॱ;
        boolean ॱॱ;
        int ᐝ;

        public j(j jVar) {
            this.ˏ = null;
            this.ˎ = ov.ˊ;
            if (jVar != null) {
                this.ॱ = jVar.ॱ;
                this.ˋ = new g(jVar.ˋ);
                if (jVar.ˋ.ˋ != null) {
                    this.ˋ.ˋ = new Paint(jVar.ˋ.ˋ);
                }
                if (jVar.ˋ.ˏ != null) {
                    this.ˋ.ˏ = new Paint(jVar.ˋ.ˏ);
                }
                this.ˏ = jVar.ˏ;
                this.ˎ = jVar.ˎ;
                this.ˊ = jVar.ˊ;
            }
        }

        public void ॱ(Canvas canvas, ColorFilter colorFilter, Rect rect) {
            canvas.drawBitmap(this.ʽ, null, rect, ˏ(colorFilter));
        }

        public boolean ˎ() {
            return this.ˋ.getRootAlpha() < 255;
        }

        public Paint ˏ(ColorFilter colorFilter) {
            if (!ˎ() && colorFilter == null) {
                return null;
            }
            if (this.ˋॱ == null) {
                this.ˋॱ = new Paint();
                this.ˋॱ.setFilterBitmap(true);
            }
            this.ˋॱ.setAlpha(this.ˋ.getRootAlpha());
            this.ˋॱ.setColorFilter(colorFilter);
            return this.ˋॱ;
        }

        public void ˎ(int i, int i2) {
            this.ʽ.eraseColor(0);
            this.ˋ.ˏ(new Canvas(this.ʽ), i, i2, null);
        }

        public void ॱ(int i, int i2) {
            if (this.ʽ == null || !ˋ(i, i2)) {
                this.ʽ = Bitmap.createBitmap(i, i2, Config.ARGB_8888);
                this.ͺ = true;
            }
        }

        public boolean ˋ(int i, int i2) {
            if (i == this.ʽ.getWidth() && i2 == this.ʽ.getHeight()) {
                return true;
            }
            return false;
        }

        public boolean ˏ() {
            if (!this.ͺ && this.ʻ == this.ˏ && this.ʼ == this.ˎ && this.ॱॱ == this.ˊ && this.ᐝ == this.ˋ.getRootAlpha()) {
                return true;
            }
            return false;
        }

        public void ˋ() {
            this.ʻ = this.ˏ;
            this.ʼ = this.ˎ;
            this.ᐝ = this.ˋ.getRootAlpha();
            this.ॱॱ = this.ˊ;
            this.ͺ = false;
        }

        public j() {
            this.ˏ = null;
            this.ˎ = ov.ˊ;
            this.ˋ = new g();
        }

        @NonNull
        public Drawable newDrawable() {
            return new ov(this);
        }

        @NonNull
        public Drawable newDrawable(Resources resources) {
            return new ov(this);
        }

        public int getChangingConfigurations() {
            return this.ॱ;
        }

        public boolean ॱ() {
            return this.ˋ.ˊ();
        }

        public boolean ˋ(int[] iArr) {
            boolean ˎ = this.ˋ.ˎ(iArr);
            this.ͺ |= ˎ;
            return ˎ;
        }
    }

    public /* bridge */ /* synthetic */ void applyTheme(Theme theme) {
        super.applyTheme(theme);
    }

    public /* bridge */ /* synthetic */ void clearColorFilter() {
        super.clearColorFilter();
    }

    public /* bridge */ /* synthetic */ ColorFilter getColorFilter() {
        return super.getColorFilter();
    }

    public /* bridge */ /* synthetic */ Drawable getCurrent() {
        return super.getCurrent();
    }

    public /* bridge */ /* synthetic */ int getMinimumHeight() {
        return super.getMinimumHeight();
    }

    public /* bridge */ /* synthetic */ int getMinimumWidth() {
        return super.getMinimumWidth();
    }

    public /* bridge */ /* synthetic */ boolean getPadding(Rect rect) {
        return super.getPadding(rect);
    }

    public /* bridge */ /* synthetic */ int[] getState() {
        return super.getState();
    }

    public /* bridge */ /* synthetic */ Region getTransparentRegion() {
        return super.getTransparentRegion();
    }

    public /* bridge */ /* synthetic */ void jumpToCurrentState() {
        super.jumpToCurrentState();
    }

    public /* bridge */ /* synthetic */ void setChangingConfigurations(int i) {
        super.setChangingConfigurations(i);
    }

    public /* bridge */ /* synthetic */ void setColorFilter(int i, Mode mode) {
        super.setColorFilter(i, mode);
    }

    public /* bridge */ /* synthetic */ void setFilterBitmap(boolean z) {
        super.setFilterBitmap(z);
    }

    public /* bridge */ /* synthetic */ void setHotspot(float f, float f2) {
        super.setHotspot(f, f2);
    }

    public /* bridge */ /* synthetic */ void setHotspotBounds(int i, int i2, int i3, int i4) {
        super.setHotspotBounds(i, i2, i3, i4);
    }

    public /* bridge */ /* synthetic */ boolean setState(int[] iArr) {
        return super.setState(iArr);
    }

    ov() {
        this.ʼ = true;
        this.ᐝ = new float[9];
        this.ॱॱ = new Matrix();
        this.ͺ = new Rect();
        this.ॱ = new j();
    }

    ov(@NonNull j jVar) {
        this.ʼ = true;
        this.ᐝ = new float[9];
        this.ॱॱ = new Matrix();
        this.ͺ = new Rect();
        this.ॱ = jVar;
        this.ˏ = ˋ(this.ˏ, jVar.ˏ, jVar.ˎ);
    }

    public Drawable mutate() {
        if (this.ˎ != null) {
            this.ˎ.mutate();
        } else if (!this.ʽ && super.mutate() == this) {
            this.ॱ = new j(this.ॱ);
            this.ʽ = true;
        }
        return this;
    }

    Object ˏ(String str) {
        return this.ॱ.ˋ.ॱˊ.get(str);
    }

    public ConstantState getConstantState() {
        if (this.ˎ != null && VERSION.SDK_INT >= 24) {
            return new f(this.ˎ.getConstantState());
        }
        this.ॱ.ॱ = getChangingConfigurations();
        return this.ॱ;
    }

    public void draw(Canvas canvas) {
        if (this.ˎ != null) {
            this.ˎ.draw(canvas);
            return;
        }
        copyBounds(this.ͺ);
        if (this.ͺ.width() > 0 && this.ͺ.height() > 0) {
            ColorFilter colorFilter = this.ˋ == null ? this.ˏ : this.ˋ;
            canvas.getMatrix(this.ॱॱ);
            this.ॱॱ.getValues(this.ᐝ);
            float abs = Math.abs(this.ᐝ[0]);
            float abs2 = Math.abs(this.ᐝ[4]);
            float abs3 = Math.abs(this.ᐝ[1]);
            float abs4 = Math.abs(this.ᐝ[3]);
            if (!(abs3 == 0.0f && abs4 == 0.0f)) {
                abs2 = 1.0f;
                abs = 1.0f;
            }
            int height = (int) (abs2 * ((float) this.ͺ.height()));
            int min = Math.min(2048, (int) (abs * ((float) this.ͺ.width())));
            height = Math.min(2048, height);
            if (min > 0 && height > 0) {
                int save = canvas.save();
                canvas.translate((float) this.ͺ.left, (float) this.ͺ.top);
                if (ˋ()) {
                    canvas.translate((float) this.ͺ.width(), 0.0f);
                    canvas.scale(SizeModifier.STABLE_STATE_SCALE, 1.0f);
                }
                this.ͺ.offsetTo(0, 0);
                this.ॱ.ॱ(min, height);
                if (!this.ʼ) {
                    this.ॱ.ˎ(min, height);
                } else if (!this.ॱ.ˏ()) {
                    this.ॱ.ˎ(min, height);
                    this.ॱ.ˋ();
                }
                this.ॱ.ॱ(canvas, colorFilter, this.ͺ);
                canvas.restoreToCount(save);
            }
        }
    }

    public int getAlpha() {
        if (this.ˎ != null) {
            return gg.ˏ(this.ˎ);
        }
        return this.ॱ.ˋ.getRootAlpha();
    }

    public void setAlpha(int i) {
        if (this.ˎ != null) {
            this.ˎ.setAlpha(i);
        } else if (this.ॱ.ˋ.getRootAlpha() != i) {
            this.ॱ.ˋ.setRootAlpha(i);
            invalidateSelf();
        }
    }

    public void setColorFilter(ColorFilter colorFilter) {
        if (this.ˎ != null) {
            this.ˎ.setColorFilter(colorFilter);
            return;
        }
        this.ˋ = colorFilter;
        invalidateSelf();
    }

    PorterDuffColorFilter ˋ(PorterDuffColorFilter porterDuffColorFilter, ColorStateList colorStateList, Mode mode) {
        if (colorStateList == null || mode == null) {
            return null;
        }
        return new PorterDuffColorFilter(colorStateList.getColorForState(getState(), 0), mode);
    }

    public void setTint(int i) {
        if (this.ˎ != null) {
            gg.ॱ(this.ˎ, i);
        } else {
            setTintList(ColorStateList.valueOf(i));
        }
    }

    public void setTintList(ColorStateList colorStateList) {
        if (this.ˎ != null) {
            gg.ॱ(this.ˎ, colorStateList);
            return;
        }
        j jVar = this.ॱ;
        if (jVar.ˏ != colorStateList) {
            jVar.ˏ = colorStateList;
            this.ˏ = ˋ(this.ˏ, colorStateList, jVar.ˎ);
            invalidateSelf();
        }
    }

    public void setTintMode(Mode mode) {
        if (this.ˎ != null) {
            gg.ˋ(this.ˎ, mode);
            return;
        }
        j jVar = this.ॱ;
        if (jVar.ˎ != mode) {
            jVar.ˎ = mode;
            this.ˏ = ˋ(this.ˏ, jVar.ˏ, mode);
            invalidateSelf();
        }
    }

    public boolean isStateful() {
        if (this.ˎ != null) {
            return this.ˎ.isStateful();
        }
        return super.isStateful() || (this.ॱ != null && (this.ॱ.ॱ() || (this.ॱ.ˏ != null && this.ॱ.ˏ.isStateful())));
    }

    protected boolean onStateChange(int[] iArr) {
        if (this.ˎ != null) {
            return this.ˎ.setState(iArr);
        }
        boolean z = false;
        j jVar = this.ॱ;
        if (!(jVar.ˏ == null || jVar.ˎ == null)) {
            this.ˏ = ˋ(this.ˏ, jVar.ˏ, jVar.ˎ);
            invalidateSelf();
            z = true;
        }
        if (!jVar.ॱ() || !jVar.ˋ(iArr)) {
            return z;
        }
        invalidateSelf();
        return true;
    }

    public int getOpacity() {
        if (this.ˎ != null) {
            return this.ˎ.getOpacity();
        }
        return -3;
    }

    public int getIntrinsicWidth() {
        if (this.ˎ != null) {
            return this.ˎ.getIntrinsicWidth();
        }
        return (int) this.ॱ.ˋ.ॱ;
    }

    public int getIntrinsicHeight() {
        if (this.ˎ != null) {
            return this.ˎ.getIntrinsicHeight();
        }
        return (int) this.ॱ.ˋ.ˊ;
    }

    public boolean canApplyTheme() {
        if (this.ˎ != null) {
            gg.ˋ(this.ˎ);
        }
        return false;
    }

    public boolean isAutoMirrored() {
        if (this.ˎ != null) {
            return gg.ˊ(this.ˎ);
        }
        return this.ॱ.ˊ;
    }

    public void setAutoMirrored(boolean z) {
        if (this.ˎ != null) {
            gg.ˏ(this.ˎ, z);
        } else {
            this.ॱ.ˊ = z;
        }
    }

    @Nullable
    public static ov ˋ(@NonNull Resources resources, @DrawableRes int i, @Nullable Theme theme) {
        if (VERSION.SDK_INT >= 24) {
            ov ovVar = new ov();
            ovVar.ˎ = fv.ॱ(resources, i, theme);
            ovVar.ʻ = new f(ovVar.ˎ.getConstantState());
            return ovVar;
        }
        try {
            int next;
            XmlPullParser xml = resources.getXml(i);
            AttributeSet asAttributeSet = Xml.asAttributeSet(xml);
            do {
                next = xml.next();
                if (next == 2) {
                    break;
                }
            } while (next != 1);
            if (next == 2) {
                return ॱ(resources, xml, asAttributeSet, theme);
            }
            throw new XmlPullParserException("No start tag found");
        } catch (Throwable e) {
            Log.e("VectorDrawableCompat", "parser error", e);
            return null;
        } catch (Throwable e2) {
            Log.e("VectorDrawableCompat", "parser error", e2);
            return null;
        }
    }

    public static ov ॱ(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Theme theme) throws XmlPullParserException, IOException {
        ov ovVar = new ov();
        ovVar.inflate(resources, xmlPullParser, attributeSet, theme);
        return ovVar;
    }

    static int ˋ(int i, float f) {
        return (((int) (((float) Color.alpha(i)) * f)) << 24) | (16777215 & i);
    }

    public void inflate(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet) throws XmlPullParserException, IOException {
        if (this.ˎ != null) {
            this.ˎ.inflate(resources, xmlPullParser, attributeSet);
        } else {
            inflate(resources, xmlPullParser, attributeSet, null);
        }
    }

    public void inflate(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Theme theme) throws XmlPullParserException, IOException {
        if (this.ˎ != null) {
            gg.ˎ(this.ˎ, resources, xmlPullParser, attributeSet, theme);
            return;
        }
        j jVar = this.ॱ;
        jVar.ˋ = new g();
        TypedArray ˎ = fx.ˎ(resources, theme, attributeSet, op.ॱ);
        ˎ(ˎ, xmlPullParser);
        ˎ.recycle();
        jVar.ॱ = getChangingConfigurations();
        jVar.ͺ = true;
        ˎ(resources, xmlPullParser, attributeSet, theme);
        this.ˏ = ˋ(this.ˏ, jVar.ˏ, jVar.ˎ);
    }

    private static Mode ˎ(int i, Mode mode) {
        switch (i) {
            case 3:
                return Mode.SRC_OVER;
            case 5:
                return Mode.SRC_IN;
            case 9:
                return Mode.SRC_ATOP;
            case 14:
                return Mode.MULTIPLY;
            case 15:
                return Mode.SCREEN;
            case 16:
                return Mode.ADD;
            default:
                return mode;
        }
    }

    private void ˎ(TypedArray typedArray, XmlPullParser xmlPullParser) throws XmlPullParserException {
        j jVar = this.ॱ;
        g gVar = jVar.ˋ;
        jVar.ˎ = ˎ(fx.ˊ(typedArray, xmlPullParser, "tintMode", 6, -1), Mode.SRC_IN);
        ColorStateList colorStateList = typedArray.getColorStateList(1);
        if (colorStateList != null) {
            jVar.ˏ = colorStateList;
        }
        jVar.ˊ = fx.ˏ(typedArray, xmlPullParser, "autoMirrored", 5, jVar.ˊ);
        gVar.ॱॱ = fx.ॱ(typedArray, xmlPullParser, "viewportWidth", 7, gVar.ॱॱ);
        gVar.ʼ = fx.ॱ(typedArray, xmlPullParser, "viewportHeight", 8, gVar.ʼ);
        if (gVar.ॱॱ <= 0.0f) {
            throw new XmlPullParserException(typedArray.getPositionDescription() + "<vector> tag requires viewportWidth > 0");
        } else if (gVar.ʼ <= 0.0f) {
            throw new XmlPullParserException(typedArray.getPositionDescription() + "<vector> tag requires viewportHeight > 0");
        } else {
            gVar.ॱ = typedArray.getDimension(3, gVar.ॱ);
            gVar.ˊ = typedArray.getDimension(2, gVar.ˊ);
            if (gVar.ॱ <= 0.0f) {
                throw new XmlPullParserException(typedArray.getPositionDescription() + "<vector> tag requires width > 0");
            } else if (gVar.ˊ <= 0.0f) {
                throw new XmlPullParserException(typedArray.getPositionDescription() + "<vector> tag requires height > 0");
            } else {
                gVar.setAlpha(fx.ॱ(typedArray, xmlPullParser, "alpha", 4, gVar.getAlpha()));
                String string = typedArray.getString(0);
                if (string != null) {
                    gVar.ʻ = string;
                    gVar.ॱˊ.put(string, gVar);
                }
            }
        }
    }

    private void ˎ(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Theme theme) throws XmlPullParserException, IOException {
        j jVar = this.ॱ;
        g gVar = jVar.ˋ;
        ArrayDeque arrayDeque = new ArrayDeque();
        arrayDeque.push(gVar.ˎ);
        int eventType = xmlPullParser.getEventType();
        int depth = xmlPullParser.getDepth() + 1;
        Object obj = 1;
        while (eventType != 1 && (xmlPullParser.getDepth() >= depth || eventType != 3)) {
            if (eventType == 2) {
                Object obj2;
                String name = xmlPullParser.getName();
                c cVar = (c) arrayDeque.peek();
                if ("path".equals(name)) {
                    b bVar = new b();
                    bVar.ˏ(resources, attributeSet, theme, xmlPullParser);
                    cVar.ॱ.add(bVar);
                    if (bVar.getPathName() != null) {
                        gVar.ॱˊ.put(bVar.getPathName(), bVar);
                    }
                    obj2 = null;
                    jVar.ॱ = bVar.ˏॱ | jVar.ॱ;
                } else if ("clip-path".equals(name)) {
                    d dVar = new d();
                    dVar.ˋ(resources, attributeSet, theme, xmlPullParser);
                    cVar.ॱ.add(dVar);
                    if (dVar.getPathName() != null) {
                        gVar.ॱˊ.put(dVar.getPathName(), dVar);
                    }
                    jVar.ॱ |= dVar.ˏॱ;
                    obj2 = obj;
                } else {
                    if ("group".equals(name)) {
                        c cVar2 = new c();
                        cVar2.ˏ(resources, attributeSet, theme, xmlPullParser);
                        cVar.ॱ.add(cVar2);
                        arrayDeque.push(cVar2);
                        if (cVar2.getGroupName() != null) {
                            gVar.ॱˊ.put(cVar2.getGroupName(), cVar2);
                        }
                        jVar.ॱ |= cVar2.ˏ;
                    }
                    obj2 = obj;
                }
                obj = obj2;
            } else if (eventType == 3) {
                if ("group".equals(xmlPullParser.getName())) {
                    arrayDeque.pop();
                }
            }
            eventType = xmlPullParser.next();
        }
        if (obj != null) {
            throw new XmlPullParserException("no path defined");
        }
    }

    void ॱ(boolean z) {
        this.ʼ = z;
    }

    private boolean ˋ() {
        if (VERSION.SDK_INT < 17) {
            return false;
        }
        if (isAutoMirrored() && gg.ᐝ(this) == 1) {
            return true;
        }
        return false;
    }

    protected void onBoundsChange(Rect rect) {
        if (this.ˎ != null) {
            this.ˎ.setBounds(rect);
        }
    }

    public int getChangingConfigurations() {
        if (this.ˎ != null) {
            return this.ˎ.getChangingConfigurations();
        }
        return super.getChangingConfigurations() | this.ॱ.getChangingConfigurations();
    }

    public void invalidateSelf() {
        if (this.ˎ != null) {
            this.ˎ.invalidateSelf();
        } else {
            super.invalidateSelf();
        }
    }

    public void scheduleSelf(Runnable runnable, long j) {
        if (this.ˎ != null) {
            this.ˎ.scheduleSelf(runnable, j);
        } else {
            super.scheduleSelf(runnable, j);
        }
    }

    public boolean setVisible(boolean z, boolean z2) {
        if (this.ˎ != null) {
            return this.ˎ.setVisible(z, z2);
        }
        return super.setVisible(z, z2);
    }

    public void unscheduleSelf(Runnable runnable) {
        if (this.ˎ != null) {
            this.ˎ.unscheduleSelf(runnable);
        } else {
            super.unscheduleSelf(runnable);
        }
    }
}
